package com.mask.userconsumer;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController

public class MainController {

    @Qualifier("com.mask.userconsumer.ConsumerApi")
    @Autowired
    ConsumerApi api;

    @Autowired
    RestService restService;

    @Value("${server.port}")
    String port;

    @GetMapping(value = "/alive")
    public String alive(){
        System.out.println("Feign远程调用成功");
        //带参传递
//        return consumerApi.getById("mask");

        return "Consumer:"+ port + "->>>>" +api.alive();
    }

//    @RequestMapping(value = "/getById")
//    public String getByName(String name){
//        System.out.println("Feign远程调用成功");
//        return consumerApi.getById(name);
//    }
}
